import { JSEncrypt } from 'encryptlong'

import defaultSetting from '@/settings'

export function encryptData(data) {
  // 新建JSEncrypt对象
  const encryptor = new JSEncrypt()
  // 设置公钥
  encryptor.setPublicKey(defaultSetting.publicKey)
  // 加密数据
  return encryptor.encryptLong(data)
}
